package com.itheima.demo.demo03;

import java.util.HashSet;
import java.util.Set;

public class person01 {
    public static void main(String[] args) {
        HashSet<Person> set=new HashSet<>();
        Person p1=new Person("张三",87);
        Person p2=new Person("张三",87);
        Person p3=new Person("张四",16);
        set.add(p1);
        set.add(p2);
        set.add(p3);
        System.out.println(p1==p2);
        System.out.println(p1.equals(p2));
        for (Person p : set) {
            System.out.println(p.toString());
        }


    }



}
